﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MVX.BASE
{
	public partial class BaseForm : Form
	{
		private TextBox inputTextBox;
		private Button showButton;
		private Label outputLabel;

		public BaseForm()
		{
			InitializeComponent();
			InitializeCustomComponents();
		}

		private void InitializeCustomComponents()
		{
			// 创建文本框
			inputTextBox = new TextBox
			{
				Location = new System.Drawing.Point(10, 10),
				Width = 200
			};

			// 创建按钮
			showButton = new Button
			{
				Text = "Show",
				Location = new System.Drawing.Point(220, 10)
			};
			showButton.Click += ShowButton_Click; // 事件处理

			// 创建标签
			outputLabel = new Label
			{
				Location = new System.Drawing.Point(10, 50),
				Width = 300
			};

			// 将控件添加到窗体
			Controls.Add(inputTextBox);
			Controls.Add(showButton);
			Controls.Add(outputLabel);
		}

		private void ShowButton_Click(object sender, EventArgs e)
		{
			// 当按钮被点击时，显示文本框中的内容
			outputLabel.Text = "You entered: " + inputTextBox.Text;
		}
	}
}
